package org.fog.json.make;

import org.fog.json.exception.JsonRelationException;
import org.fog.json.exception.JsonTypeException;
import org.fog.json.map.JsonMapBody;

import java.util.ArrayList;

/**
 * User: 缪凯
 * Date: 12-2-27
 * Time: 下午10:12
 */
public class JsonCubeImp implements JsonCube{
    private JsonMapBody map = null;

    public void joinCube(JsonCube cube) throws JsonRelationException {
        //todo
    }

    public JsonMapBody getMap() {
        return null;  //Todo
    }

    public <T> T getObjectValue(String fName) {
        return null;  //Todo
    }

    public void setObjectVS(String fName, String value) throws JsonTypeException {
        //Todo
    }

    public String getObjectVS(String fName) throws JsonTypeException {
        return null;  //Todo
    }

    public <T> T getArrayValue(String fName, int index) {
        return null;  //Todo
    }

    public void setArrayVS(String fName, String value, int index) throws JsonTypeException {
        //Todo
    }

    public String getArrayVS(String fName, int index) throws JsonTypeException {
        return null;  //Todo
    }

    /**
     *
     */
    protected static class JsonArray implements Json{ //todo
        private JsonMapBody map = null;

        public ArrayList<String[]> values = null;

        public JsonArray(JsonMapBody map){
            this.map = map;
        }

        /**
         * 获取当前json的Map
         *
         * @return 返回Map信息
         */
        public JsonMapBody getMap() {
            return this.map;
        }

        public String toJson() {
            if(this.values != null){
               for(String[] value : this.values)
                   for (String v : value){}

            }
            return null;  //todo
        }
    }

    protected static class JsonObject implements Json{ //todo
        public JsonObject(JsonMapBody map){

        }

        /**
         * 获取当前json的Map
         *
         * @return 返回Map信息
         */
        public JsonMapBody getMap() {
            return null;  //todo
        }

        public String toJson() {
            return null;  //todo
        }
    }
}
